//
// Created by amon.huang on 2021/7/25.
//

#ifndef AMONPLAYER_PUSHJNICALL_H
#define AMONPLAYER_PUSHJNICALL_H

#include "jni.h"
#include "PushPacketQueue.h"

enum PushThreadMode{
    PUSH_THREAD_CHILD, PUSH_THREAD_MAIN
};

class PushJNICall {
public:
    JavaVM *javaVM;
    JNIEnv *jniEnv;
    jobject jPushObj;

    jmethodID jConnectErrorMid;
    jmethodID jConnectSuccessMid;

public:
    PushJNICall(JavaVM * javaVm, JNIEnv * jniEnv, jobject jPushObj);
    ~PushJNICall();

    void onConnectError(PushThreadMode mode, int errorCode, char* msg) const;
    void onConnectSuccess(PushThreadMode mode) const;
};

#endif //AMONPLAYER_PUSHJNICALL_H
